 <script language="javascript">
	function goback(comid,announid){
		document.forms[0].action='<?=site_url("job_management/goto_title_view")?>/'+ comid + '/'+ announid;
		document.forms[0].submit();
	}
	function goaddnewlocationtitle(titleid){
		document.forms[0].action='<?=site_url("job_management/goto_addnew_titleloc")?>/'+ titleid;
		document.forms[0].submit();
	}
	function deletelocationtitle(locid,titleid){
		if(confirm("Do you want to delete this location?","Delete location")){
			document.forms[0].action='<?=site_url("job_management/delete_titleloc")?>/'+ locid + '/'+ titleid;
			document.forms[0].submit();
		}
	}
</script>
	<h3 class="capture">Job Management</h3>
    <div id="wrap">
    <div id="tdd_selected">
    	<div class="dd_selected">Location View</div>
        <div class="dd_view"><br />
        <form action="" method="post">
        <div>
        	Title:<input type="text" readonly="readonly" id="txttitle" name="txttitle" value="<?=htmlspecialchars($title['title_desc']);?>" />
            <?php $titleid=$title['title_id'];?>
        </div>
        	<table width="600" border="0" align="center" cellpadding="0" cellspacing="0" class="userview">
        		<tr>
        			<th>Location Id</th>
        			<th>Location</th>
                    <th>Delete</th>
        		</tr>
        		 
        		<?php foreach($all_location->result() as $location): ?>
                  <tr onmouseover="this.style.backgroundColor='#ffff66';" onmouseout="this.style.backgroundColor='#d4e3e5';">
                    <td><?=htmlspecialchars($location->loc_id);?></td>
                   	<?php $loc=$this->m_job->get_location_by_locid($location->loc_id);?>
                    <td><?=htmlspecialchars($loc['loc_desc']);?></td>
                    <td align="center"><img src="<?=base_url();?>images/recyclebin.png" width="20px" height="20px" onclick="deletelocationtitle('<?=$location->loc_id;?>','<?=$titleid;?>')" /></td>
                  </tr>
              	<?php endforeach; ?>
            </table><br />
           <div align="center">
           <?php 
		   		$companyid=$company['com_id'];
		   		$announcementid=$announ['announ_id'];
		   ?>
	           <input type="button" name="btnback" value="Back" class="bottom" onclick="goback('<?=$companyid;?>','<?=$announcementid;?>')" />
	           <input type="button" name="btnaddnew" class="bottom" value="Add New" onclick="goaddnewlocationtitle('<?=$titleid;?>')" />
	       </div><br />
        </form>
		</div>
        
    </div> 
      
  </div>


